midstory_cover <- island_cover_data$cover_mid
midstory_cover
ifelse(midstory_cover==1, 0.5, midstory_cover)
midstory_converted <- case_when(midstory_cover == 1 ~ 0.5,
midstory_cover == 2 ~ 10.5,
midstory_cover == 3 ~ 20.5,
midstory_cover == 4 ~ 38,
midstory_cover == 5 ~ 63,
midstory_cover == 6 ~ 88)
midstory_converted
island_cover_data
covers_converted <- mutate(island_cover_data,
cover_mid = case_when(cover_mid == 1 ~ 0.5,
cover_mid == 2 ~ 10.5,
cover_mid == 3 ~ 20.5,
cover_mid == 4 ~ 38,
cover_mid == 5 ~ 63,
cover_mid == 6 ~ 88),
cover_n = case_when(cover_n == 1 ~ 0.5,
cover_n == 2 ~ 10.5,
cover_n == 3 ~ 20.5,
cover_n == 4 ~ 38,
cover_n == 5 ~ 63,
cover_n == 6 ~ 88),
cover_e = case_when(cover_e == 1 ~ 0.5,
cover_e == 2 ~ 10.5,
cover_e == 3 ~ 20.5,
cover_e == 4 ~ 38,
cover_e == 5 ~ 63,
cover_e == 6 ~ 88),
cover_s = case_when(cover_s == 1 ~ 0.5,
cover_s == 2 ~ 10.5,
cover_s == 3 ~ 20.5,
cover_s == 4 ~ 38,
cover_s == 5 ~ 63,
cover_s == 6 ~ 88),
cover_w = case_when(cover_w == 1 ~ 0.5,
cover_w == 2 ~ 10.5,
cover_w == 3 ~ 20.5,
cover_w == 4 ~ 38,
cover_w == 5 ~ 63,
cover_w == 6 ~ 88))
View(covers_converted)
# function to convert cover values to percent covers:
class2value <- function(cover_classes){
cover_value = case_when(cover_classes == 1 ~ 0.5,
cover_classes == 2 ~ 10.5,
cover_classes == 3 ~ 20.5,
cover_classes == 4 ~ 38,
cover_classes == 5 ~ 63,
cover_classes == 6 ~ 88,
TRUE ~ cover_classes)
return(cover_value)
}
class2value(cover_classes = c(2,3,5,1,0))
covers_converted <- mutate(island_cover_data,
cover_mid = class2value(cover_mid),
cover_n = class2value(cover_n),
cover_s = class2value(cover_s),
cover_e = class2value(cover_e),
cover_w = class2value(cover_w))
covers_converted
covers_converted <- mutate(island_cover_data,
across(cover_mid:cover_w, class2value))
covers_converted
covers_converted <- mutate(island_cover_data, across(contains("cover_"), class2value))
covers_converted
# First load the tidyverse packages and then
# upload the saved dataframe from the last part:
library(tidyverse)
covers_converted <- read_csv("data/covers_converted.csv")
covers_converted
covers_data_semifinal <- mutate(covers_converted,
cover_n = ifelse(covertype=="understory" & is.na(cover_n), 0, cover_n),
cover_e = ifelse(covertype=="understory" & is.na(cover_e), 0, cover_e),
cover_w = ifelse(covertype=="understory" & is.na(cover_w), 0, cover_w),
cover_s = ifelse(covertype=="understory" & is.na(cover_s), 0, cover_s),
cover_under = (cover_n + cover_e + cover_w + cover_s)/4)
covers_converted
covers_data_semifinal <- mutate(covers_converted,
cover_N = ifelse(covertype=="understory" & is.na(cover_N), 0, cover_N),
cover_E = ifelse(covertype=="understory" & is.na(cover_E), 0, cover_E),
cover_W = ifelse(covertype=="understory" & is.na(cover_W), 0, cover_W),
cover_S = ifelse(covertype=="understory" & is.na(cover_S), 0, cover_S),
cover_under = (cover_N + cover_E + cover_W + cover_S)/4)
covers_data_semifinal
covers_data_semifinal <- mutate(covers_converted,
cover_N = ifelse(covertype=="understory" & is.na(cover_N), 0, cover_N),
cover_E = ifelse(covertype=="understory" & is.na(cover_E), 0, cover_E),
cover_W = ifelse(covertype=="understory" & is.na(cover_W), 0, cover_W),
cover_S = ifelse(covertype=="understory" & is.na(cover_S), 0, cover_S),
cover_under = (cover_N + cover_E + cover_W + cover_S)/4) %>%
select(-(cover_N:cover_W))
covers_data_semifinal
covers_data_coalesced <- mutate(covers_data_semifinal, cover = coalesce(cover_mid, cover_under)) %>%
select(-(cover_mid:cover_under))
covers_data_coalesced
covers_data_fin <- pivot_wider(covers_data_coalesced, names_from=covertype, values_from=cover)
covers_data_fin
View(covers_data_fin)
View(covers_data_semifinal)
View(covers_data_coalesced)
covers_data_nodupes <- group_by(covers_data_coalesced, island, plot, species, covertype) %>%
summarize(cover = mean(cover, na.rm=T))
covers_data_fin <- pivot_wider(covers_data_nodupes, names_from=covertype, values_from=cover)
View(covers_data_fin)
covers_data_fin <- pivot_wider(covers_data_nodupes, names_from=covertype, values_from=cover,
values_fill = 0)
View(covers_data_fin)
View(covers_data_fin)
covers_data_summ <- group_by(covers_data_fin, island, species) %>%
summarize(understory = mean(understory), midstory = mean(midstory)) %>%
ungroup()
covers_data_summ
island_soil <- read_csv("data/island_soil_data_raw.csv")
island_spatial <- read_csv("data/island_spatial_data_raw.csv")
island_spatial
covers_data_all <- left_join(covers_data_fin, island_spatial, by=c("island"="ISLAND")) %>%
left_join(island_soil)
covers_data_all
covers_data_all <- left_join(covers_data_fin, island_spatial, by=c("island"="ISLAND")) %>%
left_join(island_soil) %>%
rename(area_ha = AREA_HA, distance_m = DIST_M, clay = Clay_perc, silt = Silt_perc, sand = Sand_perc)
covers_data_all
# First load the tidyverse packages and then
# upload the saved dataframe from the last part:
library(tidyverse)
covers_data_all <- read_csv("data/covers_data_all.csv")
covers_data_all
filter(covers_data_all, species == "baccharis halimifolia")
b_halimifolia <- filter(covers_data_all, species == "baccharis halimifolia")
plot(understory ~ clay, data=b_halimifolia)
length(unique(covers_data_all$species))
20*93
nrows(covers_data_all)
nrow(covers_data_all)
covers_data_summ <- read_csv("data/covers_data_summ.csv")
covers_data_summ
covers_data_comp <- complete(covers_data_summ, expand(covers_data_summ, island, species))
covers_data_comp
covers_data_comp <- complete(covers_data_summ, expand(covers_data_summ, island, species),
fill=list(understory=0, midstory=0))
covers_data_comp
b_halimifolia <- filter(covers_data_comp, species == "baccharis halimifolia")
b_halimifolia
plot(understory ~ clay, data=b_halimifolia)
island_soils <- read_csv("data/island_soil_data_raw.csv")
island_soils
covers_data_comp
b_halimifolia <- filter(covers_data_comp, species == "baccharis halimifolia") %>%
left_join(island_soils)
b_halimifolia
plot(understory ~ clay, data=b_halimifolia)
plot(understory ~ Clay_perc, data=b_halimifolia)
# First let's load the tidyverse package and the cleaned dataframe
# from the last lesson:
library(tidyverse)
covers_data_all <- read_csv("data/covers_data_all_part3.csv")
covers_data_all
spp_by_site <- select(covers_data_all, island, species, understory)
spp_by_site
spp_by_site_removed0 <- group_by(spp_by_site, species) %>%
filter(sum(understory) > 0) %>%
ungroup()
spp_by_site_removed0
nrow(spp_by_site)
nrow(spp_by_site_removed0)
spp_by_site_wider <- pivot_wider(spp_by_site_removed0, names_from=species, values_from=understory)
View(spp_by_site_wider)
spp_by_site_wider
islands <- spp_by_site_wider$island
islands
spp_by_site_noisle <- select(spp_by_site_wider, -island)
View(spp_by_site_noisle)
spp_by_site_mat <- as.matrix(spp_by_site_noisle)
View(spp_by_site_mat)
row.names(spp_by_site_mat)
row.names(spp_by_site_mat) <- islands
View(spp_by_site_mat)
apply(spp_by_site_mat, MARGIN=2, FUN=mean)
apply(spp_by_site_mat, MARGIN=1, FUN=mean)
library("vegan")
set.seed(123)
nmds_plot <- metaMDS(comm = spp_by_site_mat)
plot(nmds_plot, display="sites", type="n")
text(nmds_plot)
rsconnect::setAccountInfo(name='lnegoita', token='87781719F93C92C3D46DF9790C74B9C1', secret='5D+oBM2kXacYODqXRLyKBBmNbSQipgnPFLTWdPNo')
# First here is the code to load and cleanup the mammal exclosure vegetation data from the previous exercise file
# "mammal_exc_vegetation.csv":
library(tidyverse)
mammal_exc_veg <- read_csv("data/mammal_exc_vegetation.csv")
veg_data <- select(mammal_exc_veg, year = YEAR, month=MONTH, site=SITE, block=BLOCK, treatment=TREATMENT,
plot=PLOT, subplot=COORDINATE, Abutilon:unknown_F) %>%
filter(treatment == "TOTAL" | treatment == "OPEN") %>%
select(year:subplot, everything())
View(veg_data)
# Now also load the mammal exclosure habitat data "mammal_exc_habitat.csv":
mammal_exc_hab <- read_csv("data/mammal_exc_habitat.csv")
mammal_exc_hab
# First here is the code to load and cleanup the mammal exclosure vegetation data from the previous excercise file:
library(tidyverse)
mammal_exc_veg <- read_csv("data/mammal_exc_vegetation.csv")
veg_data <- select(mammal_exc_veg, year = YEAR, month=MONTH, site=SITE, block=BLOCK, treatment=TREATMENT,
plot=PLOT, subplot=COORDINATE, Abutilon:unknown_F) %>%
filter(treatment == "TOTAL" | treatment == "OPEN") %>%
select(year:subplot, everything())
View(mammal_exc_veg)
View(veg_data)
# Now also load the mammal exclosure habitat data "mammal_exc_habitat.csv":
mammal_exc_hab <- read_csv("data/mammal_exc_habitat.csv")
View(mammal_exc_hab)
# 1) Since the vegetation surveys were conducted through repeated surveys, filter the vegetation
# dataframe to only the final year of data:
veg_data_sub <- filter(veg_data, year == 2013)
convert_presence <- function(spp_data){
converted <- case_when(spp_data == 0 ~ 0,
spp_data == 'B' ~ 1,
is.na(spp_data) ~ 0)
return(converted)
}
convert_presence(c(0, 'B', NA))
# 3) Use this function to convert all species presence columns:
# Hint: use the across function:
names(veg_data_sub)
veg_data_clean <- mutate(veg_data_sub, across(Abutilon:unknown_F, convert_presence))
View(veg_data_clean)
veg_data_clean$plot
# 4) Since there are 49 subplot observations for each plot, summarize those all by plot
# to create a frequency of occurrence of each species in each plot. Hint, you will need to
# use the group_by, summarize, and across functions. Another hint is that the mean of all
# 0 or 1 occurrence values is the same as its frequency:
table(veg_data_clean$plot)
veg_data_summ <- group_by(veg_data_clean, plot) %>%
summarize(across(Abutilon:unknown_F, mean))
veg_data_summ
View(veg_data_summ)
# 5) Now go back and clean up the habitat data so that the columns in common with the vegetation data
# have the same names (case sensitive) and remove the tree species columns:
names(veg_data_clean)
hab_data <- select(mammal_exc_hab, site=LEVEL, block=BLOCK, treatment=TREATMENT, plot=PLOT,
subplot=REBAR, tree_canopy=TREE_CANOPY, thicket=THICKET, herbaceous=HERBACEOUS,
slope=SLOPE, aspect=ASPECT, water_channel=WATER_CHANNEL, stony=STONY,
sandy=SANDY)
hab_data
# 6) Filter the habitat data to only those treatments that were either "OPEN" or "TOTAL" exclosure.
# Also remove the columns thicket through water_channel:
hab_data <- filter(hab_data, treatment == "OPEN" | treatment == "TOTAL") %>%
select(-c(thicket:water_channel))
hab_data
table(hab_data$tree_canopy)
hab_data
hab_plot_data <- group_by(hab_data, plot, site, block, treatment) %>%
summarize(prop_near_trees = mean(as.numeric(tree_canopy != "open")),
stony_ground = mean(as.numeric(stony == "Y")),
sandy_ground = mean(as.numeric(sandy == "Y"))) %>%
ungroup()
hab_plot_data
# Hmm, but why the NA? Let's subset the data to see whats up with
# the C2OPEN plot:
temp <- filter(hab_data, plot=="C2OPEN")
temp
View(temp)
hab_plot_data <- group_by(hab_data, plot, site, block, treatment) %>%
summarize(prop_near_trees = mean(as.numeric(tree_canopy != "open"), na.rm=T),
stony_ground = mean(as.numeric(stony == "Y"), na.rm=T),
sandy_ground = mean(as.numeric(sandy == "Y"), na.rm=T)) %>%
ungroup()
hab_plot_data
# 8) Join the vegetation summary data from question 4 to the habitat summary data from the previous question:
all_data <- left_join(hab_plot_data, veg_data_summ)
all_data <- left_join(hab_plot_data, veg_data_summ, by="plot")
all_data
# 9) Create a species X plot matrix using the vegetation frequency data from question 4:
veg_data_summ
plot_names <- veg_data_summ$plot
plot_names
spp_plot_table <- select(veg_data_summ, -plot)
spp_plot_table
spp_plot_mat <- as.matrix(spp_plot_table)
row.names(spp_plot_mat) <- plot_names
View(spp_plot_mat)
# lets get the total sum of frequencies of each species:
spp_sums <- apply(spp_plot_mat, MARGIN = 2, FUN = sum)
spp_sums
# where the total sum is zero that means it does not occur at all, so remove that column, or keep only those
# that are greater than zero:
spp_plot_mat_fin <- spp_plot_mat[,spp_sums > 0]
View(spp_plot_mat_fin)
ncol(spp_plot_mat_fin)
ncol(spp_plot_mat)
# 11) Which species has the highest frequency in any one plot?
sort(apply(spp_plot_mat_fin, 2, max))
# 12) Which plot has the greatest number of species?
count_species <- function(x) sum(x > 0)
sort(apply(spp_plot_mat_fin, 1, count_species))
# First calculate species richness at in each plot:
spp_rich <- apply(spp_plot_mat_fin, 1, FUN = function(x) sum(x > 0))
spp_rich
# create a tibble dataframe with these values and their name labels:
spp_rich_data <- tibble(spp_rich, plot = names(spp_rich))
spp_rich_data
hab_plot_data
# THen add this on to the habitat data:
data_fin <- left_join(hab_plot_data, spp_rich_data, by="plot")
data_fin
# Then plot the figures:
plot(spp_rich ~ prop_near_trees, data=data_fin)
boxplot(spp_rich ~ site, data=data_fin)
# Make them a bit nicer:
plot(spp_rich ~ prop_near_trees, data=data_fin, pch=16, cex=1.5,
ylab="Species Richness", xlab="Proportion of subplots\nwith overstory trees")
boxplot(spp_rich ~ site, data=data_fin, ylab="Species Richness", xlab = "Site", col=3)
library(tidyverse)
island_plants <- read_csv("data/island_veg_data_raw.csv")
island_soil <- read_csv("data/island_soil_data_raw.csv")
island_spatial <- read_csv("data/island_spatial_data_raw.csv")
# Load the tidyverse packages:
library(tidyverse)
ff_data_raw <- read_csv("data/first_flower_data.csv")
View(ff_data_raw)
View(ff_data_raw)
ff_data_clean <- pivot_longer(ff_data_raw, cols = `1910`:`1961`, names_to = "year")
View(ff_data_clean)
species <- paste(ff_data_raw$Genus, ff_data_raw$Species)
species
length(unique(species))
52*743
nrow(ff_data_clean)
52*753
duplicated(species)
species[duplicated(species)]
ff_data_nodupes <- distinct(ff_data_clean, Genus, Species, year, .keep_all=T)
52*743
ff_data_nodupes
View(ff_data_nodupes)
ff_data_clean_fin <- select(ff_data_nodupes, -`Common Names`, -Family, -Synonym, -Site) %>%
mutate(species = paste(Genus, Species)) %>%
select(-Genus, -Species, date=value) %>%
mutate(date = ifelse(date == ".", NA, date))
View(ff_data_clean_fin)
# install.packages("lubridate")
library(lubridate)
mdy("march 5th, 2010")
dmy("5/3/2010")
View(ff_data_clean_fin)
ff_data_final <- mutate(ff_data_clean_fin, date = mdy(date))
View(ff_data_final)
ff_data_final
parsed_date <- mdy("march 5th, 2010")
parsed_date
parsed_date - 10
parsed_date - years(1)
parsed_date - months(1)
parsed_date - weeks(1)
ff_data_final <- mutate(ff_data_clean_fin, date = mdy(date) - years(100))
ff_data_final
yday(parsed_date)
month(parsed_date)
parsed_date
month(parsed_date, label=T)
ff_data_final <- mutate(ff_data_clean_fin, date = mdy(date) - years(100),
julianday = yday(date),
month = month(date, label=T),
year = as.numeric(year))
ff_data_final
ff_data_summ <- filter(ff_data_final, !is.na(date)) %>%
group_by(species) %>%
summarize(day_mean = mean(julianday, na.rm=T),
day_earliest = min(julianday, na.rm=T),
day_latest = max(julianday, na.rm=T),
sample_N = n())
View(ff_data_summ)
ff_data_summ <- filter(ff_data_final, !is.na(date)) %>%
group_by(species) %>%
summarize(day_mean = mean(julianday, na.rm=T),
day_earliest = min(julianday, na.rm=T),
day_latest = max(julianday, na.rm=T),
sample_N = n()) %>%
ungroup() %>%
filter(sample_N >= 35)
View(ff_data_summ)
ff_data_summ <- filter(ff_data_final, !is.na(date)) %>%
group_by(species) %>%
summarize(day_mean = mean(julianday, na.rm=T),
day_earliest = min(julianday, na.rm=T),
day_latest = max(julianday, na.rm=T),
sample_N = n()) %>%
ungroup() %>%
filter(sample_N >= 35) %>%
mutate(day_mean_d = dmy("01/01/1900") + day_mean,
earliest_d = dmy("01/01/1900") + day_earliest,
latest_d = dmy("01/01/1900") + day_latest,)
ff_data_summ <- filter(ff_data_final, !is.na(date)) %>%
group_by(species) %>%
summarize(day_mean = mean(julianday, na.rm=T),
day_earliest = min(julianday, na.rm=T),
day_latest = max(julianday, na.rm=T),
sample_N = n()) %>%
ungroup() %>%
filter(sample_N >= 35) %>%
mutate(day_mean_d = dmy("01/01/1900") + day_mean,
earliest_d = dmy("01/01/1900") + day_earliest,
latest_d = dmy("01/01/1900") + day_latest)
ff_data_summ
ff_data_summ
# First load the tidyverse and lubridate packages and the dataframe from
# where we left off in the last part:
library(tidyverse)
library(lubridate)
ff_data_summ <- read_csv("data/ff_data_summ.csv")
View(ff_data_summ)
###################################
##### VISUALIZATION
plot(day_mean ~ species, data=ff_data_summ)
species
###################################
##### VISUALIZATION
boxplot(day_mean ~ species, data=ff_data_summ)
ff_data_summ$species
seq_along(ff_data_summ$species)
plot(seq_along(species) ~ day_mean)
plot(seq_along(species) ~ day_mean, data=ff_data_summ)
spp_names <- ff_data_summ$species
spp_names
plot(seq_along(species) ~ day_mean, data=ff_data_summ, ylab="",
yaxt="n")
plot(seq_along(species) ~ day_mean, data=ff_data_summ, ylab="",
yaxt="n", pch=16, col="tomato2", cex=1.5)
plot(seq_along(species) ~ day_mean, data=ff_data_summ, ylab="",
yaxt="n", pch=16, col="tomato2", cex=1.5,
xlab="Julian Day of First Flower", xlim=c(60,180))
axis(side=2, at=seq_along(spp_names), labels = spp_names)
axis(side=2, at=seq_along(spp_names), labels = spp_names, las = 2)
par(mai=c(1,2, 0.5, 0.5))
plot(seq_along(species) ~ day_mean, data=ff_data_summ, ylab="",
yaxt="n", pch=16, col="tomato2", cex=1.5,
xlab="Julian Day of First Flower", xlim=c(60,180))
axis(side=2, at=seq_along(spp_names), labels = spp_names, las = 2)
arrows(y0 = seq_along(spp_names) y1 = seq_along(spp_names),
x0 = ff_data_summ$day_mean, x1 = ff_data_summ$day_latest)
arrows(y0 = seq_along(spp_names), y1 = seq_along(spp_names),
x0 = ff_data_summ$day_mean, x1 = ff_data_summ$day_latest)
arrows(y0 = seq_along(spp_names), y1 = seq_along(spp_names),
x0 = ff_data_summ$day_mean, x1 = ff_data_summ$day_latest,
col="tomato2", lwd=2)
arrows(y0 = seq_along(spp_names), y1 = seq_along(spp_names),
x0 = ff_data_summ$day_mean, x1 = ff_data_summ$day_latest,
col="tomato2", lwd=2, angle=90)
par(mai=c(1,2, 0.5, 0.5))
plot(seq_along(species) ~ day_mean, data=ff_data_summ, ylab="",
yaxt="n", pch=16, col="tomato2", cex=1.5,
xlab="Julian Day of First Flower", xlim=c(60,180))
axis(side=2, at=seq_along(spp_names), labels = spp_names, las = 2)
arrows(y0 = seq_along(spp_names), y1 = seq_along(spp_names),
x0 = ff_data_summ$day_mean, x1 = ff_data_summ$day_latest,
col="tomato2", lwd=2, angle=90)
par(mai=c(1,2, 0.5, 0.5))
plot(seq_along(species) ~ day_mean, data=ff_data_summ, ylab="",
yaxt="n", pch=16, col="tomato2", cex=1.5,
xlab="Julian Day of First Flower", xlim=c(60,180))
axis(side=2, at=seq_along(spp_names), labels = spp_names, las = 2)
arrows(y0 = seq_along(spp_names), y1 = seq_along(spp_names),
x0 = ff_data_summ$day_mean, x1 = ff_data_summ$day_latest,
col="tomato2", lwd=2, angle=90, length=0.1)
arrows(y0 = seq_along(spp_names), y1 = seq_along(spp_names),
x0 = ff_data_summ$day_mean, x1 = ff_data_summ$day_earliest,
col="tomato2", lwd=2, angle=90, length=0.1)
ff_data_summ <- arrange(ff_data_summ, day_mean)
View(ff_data_summ)
spp_names
ff_data_summ_sorted <- arrange(ff_data_summ, day_mean)
spp_names_sorted <- ff_data_summ_sorted$species
spp_names_sorted
par(mai=c(1,2, 0.5, 0.5))
plot(seq_along(species) ~ day_mean, data=ff_data_summ_sorted, ylab="",
yaxt="n", pch=16, col="tomato2", cex=1.5,
xlab="Julian Day of First Flower", xlim=c(60,180))
axis(side=2, at=seq_along(spp_names_sorted), labels = spp_names_sorted, las = 2)
arrows(y0 = seq_along(spp_names_sorted), y1 = seq_along(spp_names_sorted),
x0 = ff_data_summ_sorted$day_mean, x1 = ff_data_summ_sorted$day_latest,
col="tomato2", lwd=2, angle=90, length=0.1)
arrows(y0 = seq_along(spp_names_sorted), y1 = seq_along(spp_names_sorted),
x0 = ff_data_summ_sorted$day_mean, x1 = ff_data_summ_sorted$day_earliest,
col="tomato2", lwd=2, angle=90, length=0.1)
ff_data_summ_sorted <- arrange(ff_data_summ, desc(day_mean))
spp_names_sorted <- ff_data_summ_sorted$species
par(mai=c(1,2, 0.5, 0.5))
plot(seq_along(species) ~ day_mean, data=ff_data_summ_sorted, ylab="",
yaxt="n", pch=16, col="tomato2", cex=1.5,
xlab="Julian Day of First Flower", xlim=c(60,180))
axis(side=2, at=seq_along(spp_names_sorted), labels = spp_names_sorted, las = 2)
arrows(y0 = seq_along(spp_names_sorted), y1 = seq_along(spp_names_sorted),
x0 = ff_data_summ_sorted$day_mean, x1 = ff_data_summ_sorted$day_latest,
col="tomato2", lwd=2, angle=90, length=0.1)
arrows(y0 = seq_along(spp_names_sorted), y1 = seq_along(spp_names_sorted),
x0 = ff_data_summ_sorted$day_mean, x1 = ff_data_summ_sorted$day_earliest,
col="tomato2", lwd=2, angle=90, length=0.1)
par(mai=c(1,2, 0.5, 0.5))
plot(seq_along(species) ~ day_mean_d, data=ff_data_summ_sorted, ylab="",
yaxt="n", pch=16, col="tomato2", cex=1.5,
xlab="Date of First Flower", xlim=c(dmy("01/03/1900"),dmy("01/07/1900")))
axis(side=2, at=seq_along(spp_names_sorted), labels = spp_names_sorted, las = 2)
arrows(y0 = seq_along(spp_names_sorted), y1 = seq_along(spp_names_sorted),
x0 = ff_data_summ_sorted$day_mean_d, x1 = ff_data_summ_sorted$day_latest_d,
col="tomato2", lwd=2, angle=90, length=0.1)
ff_data_summ_sorted
arrows(y0 = seq_along(spp_names_sorted), y1 = seq_along(spp_names_sorted),
x0 = ff_data_summ_sorted$day_mean_d, x1 = ff_data_summ_sorted$latest_d,
col="tomato2", lwd=2, angle=90, length=0.1)
arrows(y0 = seq_along(spp_names_sorted), y1 = seq_along(spp_names_sorted),
x0 = ff_data_summ_sorted$day_mean_d, x1 = ff_data_summ_sorted$earliest_d,
col="tomato2", lwd=2, angle=90, length=0.1)
